home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
vol15n11.zip
/
HKD.ZIP
/
HKDSRC.ZIP
/
HKD.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-23
|
2KB
|
78 lines
// HKD.cpp : Defines the class behaviors for the application.
// HotKey Detective version 1.0
// Copyright (c) 1996 Ziff-Davis Publishing
// First published in PC Magazine June 11, 1996
// Author: Gregory A. Wolking
#include "stdafx.h"
#include "HKD.h"
#include "HKDdlg.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHKDApp
BEGIN_MESSAGE_MAP(CHKDApp, CWinApp)
//{{AFX_MSG_MAP(CHKDApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHKDApp construction
CHKDApp::CHKDApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CHKDApp object
CHKDApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CHKDApp initialization
//////////////////////////////
// Note that I have "gutted" most of the App Wizard-generated code from
// this function since I'm not using CHKDDlg as a "traditional" dialog box.
// In particular, I don't care about the dialog's return value; it doesn't
// matter how the user chose to exit the dialog. All code in this file
// other than this function was generated by the App Wizard.
//////////////////////////////
BOOL CHKDApp::InitInstance()
{
ATOM myAtom;
// See if our atom exists in the global atom table.
if (GlobalFindAtom("HKD Active"))
{
// If it does, we're already running so present a message and shut down.
MessageBox(NULL, "You may only run one instance of this program", "HotKey Detective", MB_OK);
return FALSE;
}
else
{
// Otherwise, we're the only instance so install our atom.
myAtom = GlobalAddAtom("HKD Active");
}
Enable3dControls();
// Create an instance of our main dialog.
CHKDDlg dlg;
m_pMainWnd = &dlg;
// Display it as a modal window.
dlg.DoModal();
// Remove our atom from the global atom table.
GlobalDeleteAtom(myAtom);
// Return FALSE to shut down the application.
return FALSE;
}